package fr.inserm.umr915.libjson.bdb;


import com.sleepycat.bind.tuple.TupleBinding;
import com.sleepycat.bind.tuple.TupleInput;
import com.sleepycat.bind.tuple.TupleOutput;
import com.sleepycat.je.DatabaseEntry;

import fr.inserm.umr915.libjson.Node;
import fr.inserm.umr915.libjson.ObjectNode;

public abstract class AbstractNodeBinding  extends TupleBinding<Node>
	{
	protected AbstractNodeBinding()
		{
		}
	
	public final Node entryToNode(TupleInput in)	
		{
		return entryToObject(in);
		}
	
	public ObjectNode entryToObjectNode(TupleInput in)	
		{
		return entryToObject(in).asObjectNode();
		}
	
	public final void nodeToEntry(Node node, DatabaseEntry out)
		{
		objectToEntry(node, out);
		}
	public final void nodeToEntry(Node node, TupleOutput out)
		{
		objectToEntry(node, out);
		}
	}
